/*
 * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙，邂逅框架梦]
 * 
 * 知启蒙Servlet兼容库（zhiqim_servlet）在LGPL3.0协议下开源：https://www.zhiqim.com/gitcan/zhiqim/zhiqim_servlet.htm
 *
 * This file is part of [zhiqim_servlet].
 * 
 * [zhiqim_servlet] is free software: you can redistribute
 * it and/or modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 * 
 * [zhiqim_servlet] is distributed in the hope that it will
 * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with [zhiqim_servlet].
 * If not, see <http://www.gnu.org/licenses/>.
 */
package org.zhiqim.calendar.model;

/**
 * 日历模型，包括日期所在上月/当前/下月,日期和是否休息日
 *
 * @version v1.0.0 @author zouzhigang 2017-11-8 新建与整理
 */
public class CalendarModel
{
    private String calendarMonth;
    private int calendarDate;
    private boolean calendarRest;
    
    private int year;
    private int month;
    private int day;
    
    /****************************************************************/
    //设置属性
    /****************************************************************/

    public void setCalendarMonth(String calendarMonth)
    {
        this.calendarMonth = calendarMonth;
    }

    public void setCalendarRest(boolean calendarRest)
    {
        this.calendarRest = calendarRest;
    }
    
    public void setCalendarDate(int year, int month, int day)
    {
        this.calendarDate = year * 10000 + month * 100 + day;
        
        this.year = year;
        this.month = month;
        this.day = day;
    }
    
    public void setCalendarDate(int calendarDate)
    {
        this.calendarDate = calendarDate;
        
        this.year = calendarDate / 10000;
        this.month = calendarDate / 100 % 100;
        this.day = calendarDate % 100;
    }
    
    /****************************************************************/
    //获取属性
    /****************************************************************/
    
    public String getCalendarMonth()
    {
        return calendarMonth;
    }
    
    public boolean isCalendarRest()
    {
        return calendarRest;
    }
    
    public int getCalendarDate()
    {
        return calendarDate;
    }
    
    public int getYear()
    {
        return year;
    }

    public int getMonth()
    {
        return month;
    }

    public int getDay()
    {
        return day;
    }
}
